package org.sudoku.solver.examples;

import org.sudoku.solver.I9X9Solver;
import org.sudoku.solver.ISolver;
import org.sudoku.solver.ProbabilisticInferenceSolver;
import org.sudoku.solver.ProbabilisticSolver;
import org.sudoku.solver.Samurai;
import org.sudoku.solver.SamuraiSodokuSolver;

/**
 * 
 * @author shivkumar cm
 *
 */
public class SamuraiSudokuSolverExample {
	public static void main(String args[]) {
		
		I9X9Solver _9x9solvers[] = new I9X9Solver[Samurai.GRIDS];
		
		for(int i=0; i<Samurai.GRIDS; ++i) {
			_9x9solvers[i] = new ProbabilisticInferenceSolver();
		}
		ISolver solver = new SamuraiSodokuSolver(_9x9solvers);

		solver.readProblem(new String[] {
				"000200700XXX800700000",
				"700350120XXX506209807",
				"802400300XXX900005020",
				"600804500XXX408107502",
				"250010040XXX300002004",
				"400700002XXX007000000",
				"080006273500080923701",
				"000080400760102000408",
				"507900000400009000000",
				"XXXXXX000209040XXXXXX",
				"XXXXXX985600201XXXXXX",
				"XXXXXX040100800XXXXXX",
				"405000000000467050809",
				"100050708306900208700",
				"009037504907300700600",
				"000600100XXX074026008",
				"600502907XXX100000200",
				"052001040XXX600080070",
				"200790600XXX003607040",
				"000010200XXX040000500",
				"016020003XXX001002380"
		});
		
		System.out.println("Given problem: ");
		solver.prettyPrint();
		
		solver.solve();
	}
}
